import request from '@/utils/request'
import store from '@/store'

export function getShopList(data) {
	if (!data.shopId && store.getters.userShopId) {
		data.shopId = store.getters.userShopId
	}
	return request({
		url: '/business_admin/shop/list',
		method: 'post',
		data: data
	})
}

// export function getAllShop() {
// 	return request({
// 		url: '/business_admin/shop/all',
// 		method: 'get'
// 	})
// }
// 公域
export function getAllShop() {
	return request({
		url: 'business_admin/pubDomainShop/getShops',
		method: 'get'
	})
}

export function getShopInfo(shopId) {
	return request({
		url: '/business_admin/shop/info',
		method: 'post',
		params: {
			shopId
		}
	})
}

export function updateShop(data) {
	return request({
		url: '/business_admin/shop/update',
		method: 'post',
		data: data
	})
}

export function createShop(data) {
	return request({
		url: '/business_admin/shop/create',
		method: 'post',
		data: data
	})
}

// 获取单个门店二维码
export function getShopPromoteQrCode(params) {
	return request({
		url: '/business_admin/shop/get_register_qrcode',
		method: 'get',
		params: params
	})
}

// 获取单个门店二维码
export function updateShopStatus(params) {
	return request({
		url: '/business_admin/shop/update_status',
		method: 'post',
		data: params
	})
}

/**
 * @method  getShopListByIds
 * @description 根据ids获取门店列表
 */
export function getShopListByIds(data) {
	return request({
		url: '/memberAdmin/business/shopList',
		method: 'post',
		data: data
	})
}

export function saveShopManageOtherConfig(data) {
	return request({
		url: '/booking_admin/shop_manage/config',
		method: 'post',
		data: data
	})
}

// 会员日详情--超级会员--部分合作商户查询接口
export function getSuperShop(data) {
	return request({
		url: '/business_admin/superMember/activity/memberDay',
		method: 'get',
		params: {
			id: data.id
		}
	})
}
// 会员生日--超级会员--部分合作商户查询接口
export function getSuperShopBirthday(data) {
	return request({
		url: '/business_admin/superMember/activity/memberBirthday',
		method: 'get',
		params: {
			id: data.id
		}
	})
}
// 商户地址区域
export function getArea(data) {
	return request({
		url: '/business_admin/region/getArea?type='+ data.type,
		method: 'get',
		params: {
			code: data.code,
			provinceName:data.provinceName
		}
	})
}
